package com.xiyu.service.convert.unit;

import com.xiyu.service.vo.unit.worker.WorkerGetGroupRankInfoOutput;
import com.xiyu.service.vo.unit.worker.WorkerUpdateInput;
import com.xiyu.service.vo.unit.worker.WorkerPageQueryOutput;
import com.xiyu.service.vo.unit.worker.WorkerCreateInput;
import com.xiyu.service.vo.unit.worker.WorkerSingleGetOutput;
import com.xiyu.service.model.unit.worker.UnitWorker;
import java.util.*;

import org.babyfish.jimmer.sql.ast.tuple.Tuple2;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 单位员工 Convert
 */
@Mapper
public interface WorkerConvert {
    WorkerConvert INSTANCE = Mappers.getMapper(WorkerConvert.class);


    List<WorkerPageQueryOutput> pageQueryOutputConvert(List<UnitWorker> output);

    UnitWorker createInputConvert(WorkerCreateInput input);

    WorkerSingleGetOutput singleGetOutputConvert(UnitWorker output);

    UnitWorker updateInputConvert(WorkerUpdateInput input);

    List<WorkerGetGroupRankInfoOutput> getGroupRankInfoOutputConvert(List<Tuple2<String, Long>> output);

    @Mapping(source = "_1", target = "rankName")
    @Mapping(source = "_2", target = "count")
    WorkerGetGroupRankInfoOutput getGroupRankInfoOutputConvert(Tuple2<String, Long> output);

}
